﻿using System.Collections.Generic;
using System.Linq;

namespace Entropy.Ext
{
	internal class SequentialTypeNaming : IComponentNaming
	{
	    readonly Dictionary<string, int> lastUsedIdents = new Dictionary<string, int>();
		
		public string IssueVarName(string className)
		{
			int index;
			if (lastUsedIdents.TryGetValue(className, out index))
				index++;
			else
				index = 1;
			lastUsedIdents[className] = index;
			return string.Format("{0}{1}", className, index);
		}
	}
}